﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993] for details.
// All other rights reserved.
-->

<UserControl x:Class="System.Windows.Controls.Samples.AccordionSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit"
    xmlns:system="clr-namespace:System;assembly=mscorlib">
  <StackPanel>
    <ContentControl Content="Accordion" Style="{StaticResource Header}" />

    <Grid Background="White" Width="600" Height="700">
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>
      <Grid.RowDefinitions >
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
      </Grid.RowDefinitions>

    <Grid Grid.Column="0" Background="Red">
        <layoutToolkit:Accordion x:Name="acc"  >
            <layoutToolkit:AccordionItem Content="item 1" Header="A"  />
            <layoutToolkit:AccordionItem Content="item 2" Header="B -  long header" />
            <system:String>regular string item 3</system:String>
        </layoutToolkit:Accordion>
    </Grid>

        <Grid Grid.Column="1" Grid.RowSpan="2" VerticalAlignment="Top" Margin="40,0,0,0" Height="400">
        <Grid.ColumnDefinitions>
          <ColumnDefinition />
          <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBlock Text="Selection Mode" Grid.Column="0" Grid.Row="0" Margin="4" />
        <ComboBox x:Name="cbSelectionMode" 
                  Grid.Column="1"
                  Grid.Row="0"
                  SelectionChanged="SelectionModeChanged" 
                  Margin="4" >
          <ComboBoxItem Content="One" />
          <ComboBoxItem Content="OneOrMore" />
          <ComboBoxItem Content="ZeroOrOne" />
          <ComboBoxItem Content="ZeroOrMore" />
        </ComboBox>

        <TextBlock Text="Expand Direction" Grid.Column="0" Grid.Row="1" Margin="4" />
        <ComboBox x:Name="cbExpandDirection" 
                  Grid.Column="1"
                  Grid.Row="1"
                  SelectionChanged="ExpandDirectionChanged" 
                  Margin="4" >
          <ComboBoxItem Content="Up" />
          <ComboBoxItem Content="Down" />
          <ComboBoxItem Content="Left" />
          <ComboBoxItem Content="Right" />
        </ComboBox>


        <TextBlock Text="Sequence:" Grid.Column="0" Grid.Row="2" Margin="4" />
        <ComboBox x:Name="cbSelectionSequence" 
                  Grid.Column="1"
                  Grid.Row="2"
                  SelectionChanged="SelectionSequenceChanged" 
                  Margin="4">
          <ComboBoxItem Content="CollapseBeforeExpand" />
          <ComboBoxItem Content="Simultaneous" />
        </ComboBox>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="3">
          <Button Content="select all" Click="SelectAll" Margin="4" />
          <Button Content="unselect all" Click="UnselectAll" Margin="4" />
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="4">
          <Button Content="Set explicitHeight" Click="SetHeight" Margin="4"  />
          <Button Content="Remove explicitHeight" Click="RemoveHeight" Margin="4"  />
        </StackPanel>

        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Row="5">
          <Button Content="Set explicitWidth" Click="SetWidth" Margin="4"  />
          <Button Content="Remove explicitWidth" Click="RemoveWidth" Margin="4"  />
        </StackPanel>

        <TextBlock Text="Selected indices" Grid.Row="6" Margin="4" />
        <ItemsControl x:Name="icSelectedIndices" Margin="4" Grid.Column="1" Grid.Row="6" />

        <TextBlock Text="Selected index" Grid.Row="7" Margin="4" />
        <TextBox x:Name="tbSelectedIndex" Grid.Row="8" Grid.Column="1" Margin="4" />

      </Grid>
    </Grid>
  </StackPanel>
</UserControl>
